package ooday03;

public class Test {
    public static void main(String[] args) {
        Dog[] dogs = new Dog[2];
        dogs[0] = new Dog("小白",1,"黑色");
        dogs[1] = new Dog("小黑",2,"白色");
        System.out.println(dogs[0].name);
        dogs[1].age = 3;
        dogs[0].swim();
        for (int i = 0; i < dogs.length; i++) {
            System.out.println(dogs[i].name);
            dogs[i].eat();
        }

        Chick[] chicks = new Chick[3];
        chicks[0] = new Chick("小蔡",1,"黑色");
        chicks[1] = new Chick("小徐",2,"白色");
        chicks[2] = new Chick("小徐",3,"灰色");
        for (int i = 0; i < chicks.length; i++) {
            System.out.println(chicks[i].name);
            chicks[i].eat();
        }

        Fish[] fish = new Fish[4];
        fish[0] = new Fish("小虚",1,"蓝色");
        fish[1] = new Fish("小鲲",2,"紫色");
        fish[2] = new Fish("小坤坤",1,"黄色");
        fish[3] = new Fish("大坤坤",1,"橙色");
        for (int i = 0; i < fish.length; i++) {
            System.out.println(fish[i].name);
            chicks[i].eat();
        }

    }
}
